package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.example.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface IUserMapper extends BaseMapper<User> {

    // 根据用户编号与密码查询用户信息
    @Select("SELECT * FROM user WHERE user_id = #{userId} AND password = #{password}")
    User selectUserByIdAndPass(@Param("userId") String userId, @Param("password") String password);

    // 根据用户编号查询用户表返回的行数
    @Select("SELECT COUNT(*) FROM user WHERE user_id = #{userId}")
    int selectUserByIdCount(@Param("userId") String userId);
}
